<template>
<h3>数组变化侦听</h3>
<button @click="addListHandler">添加数据</button>
<ul>
    <li v-for="(item, index) of names" :key="index">{{ item }}</li>
</ul>

<button @click="concatHandler">合并数据</button>

<h3>数组1</h3>
<p v-for="(item,  index) in num1">{{ item }}</p>
<h3>数组2</h3>
<p v-for="(item,  index) in num2">{{ item }}</p>
</template>
<script>
export default{
    data () {
        return {
            names:["iaa","ibb","icc"],
            num1:[1,2,3,4,5],
            num2:[9,8,7,6,5]
        }
    },
    methods:{
        addListHandler(e){
            this.names =  this.names.concat(["iplay"]);
            console.log(this.names);
        },
        concatHandler(){
            this.num1 = this.num1.concat(this.num2);
        }
    }
}
</script>